<template>
    <div style="background-color: darkgreen;">
        <h1>父组件</h1>
        <h3>{{ gender }}</h3>
        <button @click="gender = '女'">修改性别</button>
        <ChildComponent name="张三" :age="20" :gender="gender" />
        <ChildComponent  />
    </div>
</template>

<script setup>
import { ref } from 'vue';
import ChildComponent from './ChildComponent.vue';

const gender = ref('男');

</script>

<style scoped></style>